//
//  BDFMDBTool.h
//  BadBoy
//
//  Created by wen on 2017/1/11.
//  Copyright © 2017年 niusaibing. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <FMDB.h>
@interface BDFMDBTool : NSObject

+ (instancetype)sharedTool;
//创建表
+ (void)creatWithClass:(Class)newClass tableName:(NSString *)tableName;
//创建指定主key
+ (void)creatWithClass:(Class)newClass tableName:(NSString *)tableName primaryKey:(NSString *)primaryKey;

//插入一个对象
+ (void)insertWithObject:(id)object;
//插入一队对象
+ (void)insertWithObjectsArray:(NSArray *)objectsArray;

+ (void)replaceWithObjectsArray:(NSArray *)objectsArray;
+ (void)replaceWithObject:(id)object;

//删除数据库中一行
+ (void)deleteWithObject:(id)object;
//删除一队对象
+ (void)deleteWithObjectsArray:(NSArray *)objectsArray;
//根据条件删除数据
//+ (void)deleteWithClass:(Class)obClass condition:(NSString *)condition;

//删除某张表的所有数据
+ (void)deleteTableWithClass:(Class)tableClass;

//根据类型查询该类型所有数据
+ (NSArray *)queryWithClass:(Class)obClass;
//根据条件查询
+ (NSArray *)queryWithClass:(Class)obClass condition:(NSString *)condition;

//更新一个对象
+ (void)updateOldObject:(id)oldObject newObject:(id)newObject;

+ (void)updateObject:(id)object condition:(NSString *)condition;
@end
